package com.jf3q.sup.controller;

import com.jf3q.sup.domain.Warehouses;
import com.jf3q.sup.service.WarehousesService;
import com.jf3q.sup.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: .x77
 * @CreateTime:2024/3/27 15:43
 */
@RestController
@RequestMapping("/warehouses")
public class WarehousesController {
    @Autowired
    WarehousesService warehousesService;

    @GetMapping("/getAll")
    public ResultVo getAll(){
        try {
            List<Warehouses> list = warehousesService.list();
            return ResultVo.success("仓库",list);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
